﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TrggerCard : MonoBehaviour
{
    public GameObject light;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        transform.Rotate(Vector3.up * 60 * Time.deltaTime);
    }

    private void OnTriggerEnter(Collider other)
    {
        if(other.tag.Equals("Player"))
        {
            other.GetComponent<Tools>().isHasKeyRomm1 = true;
            Destroy(light);
            Destroy(gameObject);
        }
    }
}
